<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.tjsinfo.tjsoa.system.vo.User"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>粮油集团办公自动化协作平台</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" id="txlz7"/>
<style>
			 td {
				font:12px/170% "宋体", "新宋体", "黑体"; color:#000;
			}
			th {
				font:12px/170% "宋体", "新宋体", "黑体"; color:#000;
			}
		.ErrorDiv {
			display: none;
			position: absolute;
			border: 1px solid #FFF;
			border-bottom:none;
			z-index:1002;
			overflow: auto;
		}
		.black_overlays{
			display: none;
			position: absolute;
			top: 0%;
			left: 0%;
			width: 100%;
			height: 100%;
			background-color: #C1EBFC;
			z-index:1002;
			-moz-opacity: 0.8;
			opacity:.80;
			filter: alpha(opacity=30);
		}
		
		.lan01{
background: url(<%=basePath%>images/lanbg01.gif) no-repeat 0 0; width:6px; height:24px;} 
.lan02{
background: url(<%=basePath%>images/lanbg02.gif) repeat-x; width:99%; height:24px;}            
.lan03{
background: url(<%=basePath%>images/lanbg03.gif) no-repeat; width:8px; height:24px;}             
.cha{
padding-top:3px;}
	 </style>
		<script type='text/javascript'
			src='<%=basePath%>dwr/interface/systemUserBo.js'></script>
		<script type='text/javascript' src="<%=basePath%>dwr/engine.js"></script>
		<script type='text/javascript' src="<%=basePath%>dwr/util.js"></script>
		<%
		User user = (User) session.getAttribute("user");
		%>
		<script type="text/javascript">
		function check()
		{
	  		var id = '<%=user.getUser_id()%>';
	  		var password = document.getElementById("password").value;
	  		systemUserBo.findByIdUser(id,password,{
	  			callback:function(str) {
	  				if(str=='false'){
	  					var a = document.getElementById("diverror");
						a.innerHTML = "您输入的原始密码错误，请重新录入！";
						xianshiErrorDiv();
	  					document.getElementById("password").value = '';
	  				}else{
	  					checkvalue();
	  				}
	  			}
	  			}
	  		);
		}
		
	function  checkvalue()   
	  {   
	        if(document.form1.password1.value!=document.form1.password2.value)   
	        {   
	          alert("密码与验证密码不一致！");  
	          return; 
	        }   
	         isPasswd();
	  }   
 function isPasswd(){
	 var password=document.form1.password1.value;
	var patrn=/^(\w){6,20}$/;
	  
	  if(!patrn.exec(password)){
	  		var a = document.getElementById("diverror");
			a.innerHTML = "密码只能输入6-20个字母、数字、下划线,请重新输入！";
			xianshiErrorDiv();
	  return false;
	  }else{
	  document.form1.submit();
	 return true;
	  }
	}
	
	function closeErrorDiv(){
		document.getElementById("blackdiv").style.display = "none";
		document.getElementById("ErrorDiv").style.display = "none";
	}
	
	function xianshiErrorDiv(){
		document.getElementById("ErrorDiv").style.top = document.body.clientHeight/4;
		document.getElementById("ErrorDiv").style.left = document.body.clientWidth/8;
		document.getElementById("blackdiv").style.display = "block";
		document.getElementById("ErrorDiv").style.display = "block";
	}
</script>
	</head>

	<body>
	<div id="right" style="height: 89.5%">
	<div class="p_01">
		    <ul>
                <li class="s09"><a href="javaScript:check();">确定</a></li>
                <li class="s10"><a href="javaScript:history.go(-1);">取消</a></li>
            </ul>
	  </div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
          <tr>
            <td valign="top" height="100%">
               <div class="contabwd">
               		<table width="100%" height="400"border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="70%">
                            	<table width="399" border="0" cellspacing="0" cellpadding="0" align="center" style="margin-top:20px">
                                  <tr>
                                    <td><img src="<%=basePath%>images/changepassword.gif" /></td>
                                  </tr>
                                  <tr>
                                    <td><div class="lwxx">
                                    	<form action="<%=basePath%>tjsinfo/tjsoa/system/changePassword.do" name="form1" method="post">
                                    		<input type="hidden" id="id" name="id" value="<%=user.getUser_id()%>">
                                            <table width="361" height="271" border="0" align="center" cellpadding="0" cellspacing="0" class="ttaa">
                                              <tr>
                                                <td align="right"><img src="<%=basePath%>images/dfdf_03.gif" />&nbsp;原始密码：</td>
                                                <td><input type="password" id="password" /></td>
                                                <td>&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <td width="80" align="right"><img src="<%=basePath%>images/dfdf_03.gif" />&nbsp;新密码：</td>
                                                <td width="250"><input type="password" name="password1" /></td>
                                                <td width="21">&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <td align="right"><img src="<%=basePath%>images/dfdf_03.gif" />&nbsp;重复密码：</td>
                                                <td><input type="password" name="password2" /></td>
                                                <td>&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <th colspan="3">&nbsp;</th>
                                              </tr>
                                            </table>
                                          </form>
                                        </div>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td><img src="<%=basePath%>images/lwxx_03.gif" /></td>
                                  </tr>
                                </table>
                            </td>
                            <td width="30%" valign="bottom"><img src="<%=basePath%>images/computer02.gif" /></td>
                          </tr>
                     </table>
              </div>
            </td>
          </tr>
      </table>
</div>

<%-- 隐藏层 
	GroupDiv -- 选择组时隐藏层
	blackdiv -- 周围颜色层
--%>

<div id="blackdiv" class="black_overlays">
	<iframe style="width:100%;height:100%;filter:alpha(opacity=0);-moz-opacity:0"></iframe>
</div>


<div id="ErrorDiv" class="ErrorDiv">
<table width="478" border="0" cellpadding="0" cellspacing="0">
               <tr>
                 <td>
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td class="lan01">&nbsp;</td>
                        <td class="lan02">
                          <table width="99%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="5%" align="center" style="padding-top:3px;"><img src="<%=basePath%>images/thicon.gif" /></td>
                                <td width="89%" align="left" style="color:#FFFFFF; font-weight:bold;padding-top:3px;">系统提示</td>
                                <td width="6%"><div class="cha"><a href="javaScript:closeErrorDiv();"><img src="<%=basePath%>images/cha.gif"/></a></div></td>
                              </tr>
                           </table>
                        </td>
                        <td class="lan03">&nbsp;</td>
                      </tr>
                 </table>
                 </td>
               </tr>
               <tr>
                 <td height="109" class="zz">
                     <table width="90%" height="80%" border="0" cellspacing="0" cellpadding="0" class="researchtab">
                      <tr>
                        <td width="17%" align="center"><img src="<%=basePath%>images/tssb.gif" /></td>
                        <td width="83%" align="left"><div id="diverror"></div></td>
                      </tr>
                      <tr align="center">
                        <td colspan="2" style="border-top:1px #CFCFD1 solid"><a href="javaScript:closeErrorDiv();"><img src="<%=basePath%>images/qd.gif" /></a>
                        </td>
                       </tr>
                    </table>
                 </td>
               </tr>
             </table>
</div>
	</body>
</html>